package com.vip.common.response;

/**
 * 错误代码
 *
 * @author vip
 * @date 2019/11/27 17:05
 */
public enum ErrorCode {
    /**
     *
     */
    NO_ERROR(0,"成功"),
    DB_ERROR(1, "数据库错误"),
    INVALID_PARAMETER(2, "参数错误"),
    DATA_EXIST(3, "数据已存在"),
    LOGIN_EXCEPTION(4, "登录出错"),
    SYSTEM_ERROR(5, "系统错误"),
    LOGIC_OBEY(6, "逻辑提示"),
    FEIGN_ERROR(7, "内部调用错误"),
    SYS_ERROR(8, "系统错误"),
    NOT_LOGIN(9, "用户未登录"),
    DATA_NONE(10, "数据不存在"),
    METHOD_ERROR(10, "请求异常"),
    NO_PERMISSION(11,"无权访问"),
    FILE_UPLOAD(12, "文件上传错误"),
    FILE_DOWNLOAD(13, "文件下载错误"),
    FILE_ERROR(14, "文件错误"),
    WORKFLOW_ERROR(15, "工作流错误"),
    BIZ_ERROR(16, "业务异常"),
    ACCESS_TOKEN_INVALID(1001,"access_token无效"),
    REFRESH_TOKEN_INVALID(1002, "refresh_token无效"),
    UNAUTHORIZED(1003,"请先进行身份验证"),
    INSUFFICIENT_PERMISSIONS(1004,"未授权的访问");

    private Integer code;

    private String description;

    ErrorCode(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
